home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / results.dxr / 00002_results class.ls < prev    next >
Encoding:
Text File  |  2000-01-31  |  2.7 KB  |  103 lines

  1. property pCloseBoxObj, pFolderButtonObj, pPrinterButtonObj, pDiskButtonObj, pkListSprite, pScrollbarObj, pOpenButtonObj, pRolloverTextObj
  2.  
  3. on new me
  4.   pkListSprite = 7
  5.   pCloseBoxObj = new(script("close box button"), "close box", "Global", 5, the loc of sprite 5)
  6.   Inscope(pCloseBoxObj)
  7.   pFolderButtonObj = new(script("folder title bar button"), "search results open", "Internal", 9, the loc of sprite 9)
  8.   Inscope(pFolderButtonObj)
  9.   pPrinterButtonObj = new(script("printer title bar button"), "search results print", "Internal", 10, the loc of sprite 10)
  10.   Inscope(pPrinterButtonObj)
  11.   pDiskButtonObj = new(script("disk title bar button"), "search results save", "Internal", 11, the loc of sprite 11)
  12.   Inscope(pDiskButtonObj)
  13.   pOpenButtonObj = new(script("open button"), "open button", "Internal", 18, the loc of sprite 18)
  14.   Inscope(pOpenButtonObj)
  15.   disable(pOpenButtonObj)
  16.   rolloverList = []
  17.   addAt(rolloverList, 5, 16)
  18.   addAt(rolloverList, 9, 15)
  19.   addAt(rolloverList, 10, 11)
  20.   addAt(rolloverList, 11, 10)
  21.   pRolloverTextObj = new(script("rollover text"), rolloverList)
  22.   setupScrollbar(me)
  23.   cursor = [member("point hand"), member("point hand mask")]
  24.   repeat with rc in [5, 9, 10, 11]
  25.     set the cursor of sprite rc to cursor
  26.   end repeat
  27.   return me
  28. end
  29.  
  30. on dispose me
  31.   condemn(pCloseBoxObj)
  32.   condemn(pPrinterButtonObj)
  33.   condemn(pDiskButtonObj)
  34. end
  35.  
  36. on getHitList me
  37.   return value(the text of field "hitList field")
  38. end
  39.  
  40. on getCloseBoxObj me
  41.   return pCloseBoxObj
  42. end
  43.  
  44. on getfolderButtonObj me
  45.   return pFolderButtonObj
  46. end
  47.  
  48. on getPrinterButtonObj me
  49.   return pPrinterButtonObj
  50. end
  51.  
  52. on getDiskButtonObj me
  53.   return pDiskButtonObj
  54. end
  55.  
  56. on getScrollbarObj me
  57.   return pScrollbarObj
  58. end
  59.  
  60. on getOpenButtonObj me
  61.   return pOpenButtonObj
  62. end
  63.  
  64. on getSelection me
  65.   return(pSelection)
  66. end
  67.  
  68. on getRolloverTextObj me
  69.   return pRolloverTextObj
  70. end
  71.  
  72. on setupScrollbar me
  73.   bedChannel = 13
  74.   textChannel = 7
  75.   hiliteChannel = 1
  76.   pScrollbarObj = new(script("text scroll bar"), bedChannel, textChannel, hiliteChannel)
  77. end
  78.  
  79. on clickHitList me
  80.   clickedLine = the mouseLine
  81.   theText = line clickedLine of field "results field"
  82.   if (clickedLine <= 0) or (clickedLine > count(getHitList(me))) or (stripPunct(theText) = EMPTY) then
  83.     setSelection(pScrollbarObj, 0)
  84.     disable(pOpenButtonObj)
  85.   else
  86.     oldSelection = getSelection(pScrollbarObj)
  87.     setSelection(pScrollbarObj, clickedLine)
  88.     enable(pOpenButtonObj)
  89.     if the doubleClick or (clickedLine = oldSelection) then
  90.       openSelection(me)
  91.     end if
  92.   end if
  93. end
  94.  
  95. on openSelection me
  96.   recordNum = getAt(getHitList(me), getSelection(pScrollbarObj))
  97.   cursor(4)
  98.   tell the stage
  99.     findAndOpenMediaWindow(recordNum)
  100.   end tell
  101.   cursor(-1)
  102. end
  103.